# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Precinct do
  @moduledoc """


  ## Attributes

  *   `administrationRegionId` (*type:* `String.t`, *default:* `nil`) - ID of the AdministrationRegion message for this precinct. Corresponds to LocalityId xml tag.
  *   `contestId` (*type:* `list(String.t)`, *default:* `nil`) - ID(s) of the Contest message(s) for this precinct.
  *   `datasetId` (*type:* `String.t`, *default:* `nil`) - Required. Dataset ID. What datasets our Precincts come from.
  *   `earlyVoteSiteId` (*type:* `list(String.t)`, *default:* `nil`) - ID(s) of the PollingLocation message(s) for this precinct.
  *   `electoralDistrictId` (*type:* `list(String.t)`, *default:* `nil`) - ID(s) of the ElectoralDistrict message(s) for this precinct.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Required. A unique identifier for this precinct.
  *   `mailOnly` (*type:* `boolean()`, *default:* `nil`) - Specifies if the precinct runs mail-only elections.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. The name of the precinct.
  *   `number` (*type:* `String.t`, *default:* `nil`) - The number of the precinct.
  *   `ocdId` (*type:* `list(String.t)`, *default:* `nil`) - Encouraged. The OCD ID of the precinct
  *   `pollingLocationId` (*type:* `list(String.t)`, *default:* `nil`) - ID(s) of the PollingLocation message(s) for this precinct.
  *   `spatialBoundaryId` (*type:* `list(String.t)`, *default:* `nil`) - ID(s) of the SpatialBoundary message(s) for this precinct. Used to specify a geometrical boundary of the precinct.
  *   `splitName` (*type:* `String.t`, *default:* `nil`) - If present, this proto corresponds to one portion of split precinct. Other portions of this precinct are guaranteed to have the same `name`. If not present, this proto represents a full precicnt.
  *   `ward` (*type:* `String.t`, *default:* `nil`) - Specifies the ward the precinct is contained within.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :administrationRegionId => String.t() | nil,
          :contestId => list(String.t()) | nil,
          :datasetId => String.t() | nil,
          :earlyVoteSiteId => list(String.t()) | nil,
          :electoralDistrictId => list(String.t()) | nil,
          :id => String.t() | nil,
          :mailOnly => boolean() | nil,
          :name => String.t() | nil,
          :number => String.t() | nil,
          :ocdId => list(String.t()) | nil,
          :pollingLocationId => list(String.t()) | nil,
          :spatialBoundaryId => list(String.t()) | nil,
          :splitName => String.t() | nil,
          :ward => String.t() | nil
        }

  field(:administrationRegionId)
  field(:contestId, type: :list)
  field(:datasetId)
  field(:earlyVoteSiteId, type: :list)
  field(:electoralDistrictId, type: :list)
  field(:id)
  field(:mailOnly)
  field(:name)
  field(:number)
  field(:ocdId, type: :list)
  field(:pollingLocationId, type: :list)
  field(:spatialBoundaryId, type: :list)
  field(:splitName)
  field(:ward)
end

defimpl Poison.Decoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Precinct do
  def decode(value, options) do
    GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Precinct.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Precinct do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
